package com.dycx.food.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dycx.food.dto.GoodsDTO;
import com.dycx.food.dto.GoodsQueryDTO;
import com.dycx.food.dto.ShoppingCartDTO;
import com.dycx.food.entity.GoodsDO;
import com.dycx.food.vo.GoodsSpecVO;
import com.dycx.food.vo.GoodsVO;
import com.dycx.food.vo.ShoppingCartVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface GoodsFoodService extends IService<GoodsDO> {

    /**
     * 删除
     */
    Boolean deleteGoods(int mainGoodsId);

    /**
     * 添加商品
     */
    Boolean addGoods(GoodsDTO goodsDto);

    /**
     * 更新
     */
    Boolean updateGoods(GoodsDTO goodsDto);

    /**
     * 分页
     */
    Page<GoodsVO> getPage(GoodsDTO goodsDto);

    Page<GoodsVO> getSearchGoodsPage(GoodsDTO goodsDto);

    /**
     * 获取公共商品下的规格商品
     * @param id
     * @return
     */
    List<GoodsSpecVO> getListByMainGoodsId(Integer id);

    /**
     * 获取公共商品详情
     * @param mainGoodsId
     * @return
     */
    GoodsVO getGoodsMainDetail(int mainGoodsId);

    Boolean updateShelf(GoodsDTO goodsDto);

    Boolean batchUpdateGoodsPrice(HttpServletRequest request);

    List<GoodsVO> listSalesGoods(int num);

    List<ShoppingCartVO> listGoodsByOrder(List<ShoppingCartDTO> list);

    Page<GoodsVO> getGoodsMainPage(GoodsQueryDTO goodsDto);
}
